package com.ltkj.pay.service.impl;

import com.ltkj.common.core.utils.DateUtils;
import com.ltkj.pay.domain.TicPayLog;
import com.ltkj.pay.mapper.TicPayBusinessMapper;
import com.ltkj.pay.mapper.TicPayLogMapper;
import com.ltkj.pay.service.ITicPayLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 支付记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-09-15
 */
@Service
public class TicPayLogServiceImpl implements ITicPayLogService 
{
    @Autowired
    private TicPayLogMapper ticPayLogMapper;
    @Autowired
    private TicPayBusinessMapper ticPayBusinessMapper;

    /**
     * 查询支付记录
     * 
     * @param payId 支付记录主键
     * @return 支付记录
     */
    @Override
    public TicPayLog selectTicPayLogByPayId(Long payId)
    {
        return ticPayLogMapper.selectTicPayLogByPayId(payId);
    }

    /**
     * 查询支付记录列表
     * 
     * @param ticPayLog 支付记录
     * @return 支付记录
     */
    @Override
    public List<TicPayLog> selectTicPayLogList(TicPayLog ticPayLog)
    {
        return ticPayLogMapper.selectTicPayLogList(ticPayLog);
    }

    /**
     * 新增支付记录
     * 
     * @param ticPayLog 支付记录
     * @return 结果
     */
    @Override
    public int insertTicPayLog(TicPayLog ticPayLog)
    {
        ticPayLog.setCreateTime(DateUtils.getNowDate());
        return ticPayLogMapper.insertTicPayLog(ticPayLog);
    }

    /**
     * 修改支付记录
     * 
     * @param ticPayLog 支付记录
     * @return 结果
     */
    @Override
    public int updateTicPayLog(TicPayLog ticPayLog)
    {
        ticPayLog.setUpdateTime(DateUtils.getNowDate());
        return ticPayLogMapper.updateTicPayLog(ticPayLog);
    }

    /**
     * 批量删除支付记录
     * 
     * @param payIds 需要删除的支付记录主键
     * @return 结果
     */
    @Override
    public int deleteTicPayLogByPayIds(Long[] payIds)
    {
        return ticPayLogMapper.deleteTicPayLogByPayIds(payIds);
    }

    /**
     * 删除支付记录信息
     * 
     * @param payId 支付记录主键
     * @return 结果
     */
    @Override
    public int deleteTicPayLogByPayId(Long payId)
    {
        return ticPayLogMapper.deleteTicPayLogByPayId(payId);
    }

    @Override
    public TicPayLog selectTicPayLogByWxOrderNum(String wxOrderNum) {
        return ticPayBusinessMapper.selectTicPayLogByWxOrderNum(wxOrderNum);
    }
}
